package com.iob.coin.controller.identify;

import com.iob.coin.bl.identify.IdentifyService;
import com.iob.coin.vo.ResponseVO;
import com.iob.coin.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/identify")
public class IdentifyController {

    @Autowired
    IdentifyService identifyService;

    @GetMapping("/currentUser")
    public ResponseVO currentUser() {
        return identifyService.currentUser();
    }

    @PostMapping("/login")
    public ResponseVO login(@RequestBody UserVO userVO){
        return identifyService.login(userVO);
    }

    @PostMapping("/register")
    public ResponseVO register(@RequestBody UserVO userVO){
        return identifyService.register(userVO);
    }

    @GetMapping("/logout")
    public ResponseVO logout(){
        return identifyService.logout();
    }

}
